package com.autocloud.model.log;

import com.autocloud.model.Base;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;

/**
 * 原始请求日志
 * @author zhongwb
 * @version 1.0
 * @date 2019/12/2 11:39 下午
 */
@Entity
@Table(name = "sys_log_original")
@Accessors(chain = true)
@Data
public class LogOriginal extends Base {
    private String url;
    private double elapsedtime;
    private String ipaddress;
    private String origin;
    private String agent;
    private String language;
    private String orgunit;
    @Lob
    @Column(columnDefinition = "TEXT")
    private String body;

    public static LogOriginal of(String url
            , double elapsedtime
            , String ipaddress
            , String origin
            , String agent
            , String language
            , String orgunit
            , String account
            , String body) {
        LogOriginal logOriginal = new LogOriginal();
        logOriginal.setUrl(url);
        logOriginal.setElapsedtime(elapsedtime);
        logOriginal.setIpaddress(ipaddress);
        logOriginal.setOrigin(origin);
        logOriginal.setAgent(agent);
        logOriginal.setLanguage(language);
        logOriginal.setOrgunit(orgunit);
        logOriginal.setBody(body);
        logOriginal.setCreator(account);
        return logOriginal;
    }


}
